package com.yzt.minemodule.adapter;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.yzt.zhuju.network.entity.mine.FeedBackBean;
import com.yzt.minemodule.R;
import com.yzt.plugin_imageloader.ImageLoadUtil;
import com.yzt.plugin_widget.RoundImageView;

import java.util.List;

/**
 * author : bob
 * date   : 2022/12/8
 * desc   : 意见反馈的适配器
 */
public class FeedBackAdapter extends BaseMultiItemQuickAdapter<FeedBackBean, BaseViewHolder> {

    public FeedBackAdapter(List<FeedBackBean> data) {
        super(data);
        addItemType(FeedBackBean.ADD, R.layout.item_voucher_for_report_add_image);
        addItemType(FeedBackBean.IMAGE, R.layout.item_voucher_for_report);
        addChildClickViewIds(R.id.iv_delete);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, FeedBackBean item) {
        if (item.getItemType() == FeedBackBean.IMAGE) {
            RoundImageView ivImage = helper.getView(R.id.avatar_riv);
            ImageLoadUtil.loadIv(getContext(), item.getImageUrl(), ivImage);
        }
    }
}

